#pragma once

#include "data_model.h"

/**
 * @brief 数据管理类
 * 负责数据的加载、保存和内存存储。
 */
class DataManager {
private:
    const string DATA_FILE = "study_data.txt";
    string topicsToString(const vector<string>& topics);
    vector<string> stringToTopics(const string& s);

public:
    map<string, Problem> problems;
    map<string, Topic> topics;
    UserConfig config;

    DataManager();
    void saveData();
    void loadData();
};
